<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>ATSpartialtap</title>
    <link rel="stylesheet" type="text/css" href="csound.css" />
    <meta name="generator" content="DocBook XSL Stylesheets V1.78.1" />
    <link rel="home" href="index.html" title="The Canonical Csound Reference Manual" />
    <link rel="up" href="OpcodesTop.html" title="Orchestra Opcodes and Operators" />
    <link rel="prev" href="ATSreadnz.html" title="ATSreadnz" />
    <link rel="next" href="ATSsinnoi.html" title="ATSsinnoi" />
  </head>
  <body>
    <div class="navheader">
      <table width="100%" summary="Navigation header">
        <tr>
          <th colspan="3" align="center">ATSpartialtap</th>
        </tr>
        <tr>
          <td width="20%" align="left"><a accesskey="p" href="ATSreadnz.html">Prev</a> </td>
          <th width="60%" align="center">Orchestra Opcodes and Operators</th>
          <td width="20%" align="right"> <a accesskey="n" href="ATSsinnoi.html">Next</a></td>
        </tr>
      </table>
      <hr />
    </div>
    <div class="refentry">
      <a id="ATSpartialtap"></a>
      <div class="titlepage"></div>
      <a id="IndexATSpartialtap" class="indexterm"></a>
      <div class="refnamediv">
        <h2>
          <span class="refentrytitle">ATSpartialtap</span>
        </h2>
        <p>ATSpartialtap —  returns a frequency, amplitude pair from an <a class="link" href="ATSbufread.html" title="ATSbufread"><em class="citetitle">ATSbufread</em></a> opcode.
        </p>
      </div>
      <div class="refsect1">
        <a id="idp91073280"></a>
        <h2>Description</h2>
        <p>
            <span class="emphasis"><em>ATSpartialtap</em></span> takes a partial number and returns a frequency, amplitude pair. The frequency and amplitude data comes from an <a class="link" href="ATSbufread.html" title="ATSbufread"><em class="citetitle">ATSbufread</em></a> opcode.
        </p>
      </div>
      <div class="refsect1">
        <a id="idp91075968"></a>
        <h2>Syntax</h2>
        <pre class="synopsis">kfrq, kamp <span class="command"><strong>ATSpartialtap</strong></span> ipartialnum</pre>
      </div>
      <div class="refsect1">
        <a id="idp91078112"></a>
        <h2>Initialization</h2>
        <p>
        <span class="emphasis"><em>ipartialnum</em></span> - indicates the partial that the <span class="emphasis"><em>ATSpartialtap</em></span> opcode should read from an <a class="link" href="ATSbufread.html" title="ATSbufread"><em class="citetitle">ATSbufread</em></a>.
    </p>
      </div>
      <div class="refsect1">
        <a id="idp91081184"></a>
        <h2>Performance</h2>
        <p><span class="emphasis"><em>kfrq</em></span> - returns the frequency value for the requested partial.</p>
        <p><span class="emphasis"><em>kamp</em></span> - returns the amplitude value for the requested partial.</p>
        <p><span class="emphasis"><em>ATSpartialtap</em></span> takes a partial number and returns a frequency, amplitude pair. The frequency and amplitude data comes from an <a class="link" href="ATSbufread.html" title="ATSbufread"><em class="citetitle">ATSbufread</em></a> opcode. This is more restricted version of <a class="link" href="ATSread.html" title="ATSread"><em class="citetitle">ATSread</em></a>, since each <a class="link" href="ATSread.html" title="ATSread"><em class="citetitle">ATSread</em></a> opcode has its own independent time pointer, and <span class="emphasis"><em>ATSpartialtap</em></span> is restricted to the data given by an <a class="link" href="ATSbufread.html" title="ATSbufread"><em class="citetitle">ATSbufread</em></a>. Its simplicity is its attractive feature.</p>
      </div>
      <div class="refsect1">
        <a id="idp91088688"></a>
        <h2>Examples</h2>
        <p>
      Here is an example of the ATSpartialtap opcode. It uses the file <a class="ulink" href="examples/ATSpartialtap.csd" target="_top"><em class="citetitle">ATSpartialtap.csd</em></a>.

      </p>
        <div class="example">
          <a id="idp91090576"></a>
          <p class="title">
            <strong>Example 71. Example of the ATSpartialtap opcode.</strong>
          </p>
          <div class="example-contents">
            <pre class="programlisting">
<span class="csdtag">&lt;CsoundSynthesizer&gt;</span>
<span class="csdtag">&lt;CsOptions&gt;</span>
<span class="comment">; Select audio/midi flags here according to platform</span>
-odac     <span class="comment">;;;RT audio out</span>
<span class="comment">;-iadc    ;;;uncomment -iadc for RT audio input is needed too</span>
<span class="comment">; For Non-realtime ouput leave only the line below:</span>
<span class="comment">; -o ATSpartialtap.wav -W ;;; for file output any platform</span>
<span class="csdtag">&lt;/CsOptions&gt;</span>
<span class="csdtag">&lt;CsInstruments&gt;</span>

<span class="ohdr">sr</span> <span class="op">=</span> 44100
<span class="ohdr">ksmps</span> <span class="op">=</span> 32
<span class="ohdr">nchnls</span> <span class="op">=</span> 2
<span class="ohdr">0dbfs</span> <span class="op">=</span> 1

<span class="oblock">instr</span> 1	<span class="comment">; "beats.ats" is created by atsa</span>

ktime	<span class="opc">line</span>	0, p3, 2
	<span class="opc">ATSbufread</span> ktime, 1, "beats.ats", 30
kfreq1, kam1	<span class="opc">ATSpartialtap</span>  5
kfreq2, kam2	<span class="opc">ATSpartialtap</span>  20
kfreq3, kam3	<span class="opc">ATSpartialtap</span>  30

aout1	<span class="opc">oscil</span>	kam1, kfreq1, 1
aout2	<span class="opc">oscil</span>	kam2, kfreq2, 1
aout3	<span class="opc">oscil</span>	kam3, kfreq3, 1
aout	<span class="op">=</span>	(aout1<span class="op">+</span>aout2<span class="op">+</span>aout3)<span class="op">*</span>10	<span class="comment">; amplify some more</span>
	<span class="opc">outs</span>	aout, aout

<span class="oblock">endin</span>


<span class="csdtag">&lt;/CsInstruments&gt;</span>
<span class="csdtag">&lt;CsScore&gt;</span>
<span class="comment">; sine wave.</span>
<span class="stamnt">f</span> 1 0 16384 10 1
<span class="stamnt">i</span> 1 0 2
<span class="stamnt">e</span>

<span class="csdtag">&lt;/CsScore&gt;</span>
<span class="csdtag">&lt;/CsoundSynthesizer&gt;</span>
</pre>
          </div>
        </div>
        <p><br class="example-break" />
    </p>
        <p> This example here uses an <span class="emphasis"><em>ATSpartialtap</em></span>, and an <a class="link" href="ATSbufread.html" title="ATSbufread"><em class="citetitle">ATSbufread</em></a> to read partials 5, 20 and 30 from 'beats.ats'. These amplitudes and frequencies could be used to re-synthesize those partials, or something all together different.
        </p>
      </div>
      <div class="refsect1">
        <a id="idp91094432"></a>
        <h2>See also</h2>
        <p><a class="link" href="ATSread.html" title="ATSread"><em class="citetitle">ATSread</em></a>, 
            <a class="link" href="ATSreadnz.html" title="ATSreadnz"><em class="citetitle">ATSreadnz</em></a>, 
            <a class="link" href="ATSinfo.html" title="ATSinfo"><em class="citetitle">ATSinfo</em></a>, 
            <a class="link" href="ATSsinnoi.html" title="ATSsinnoi"><em class="citetitle">ATSsinnoi</em></a>, 
            <a class="link" href="ATSbufread.html" title="ATSbufread"><em class="citetitle">ATSbufread</em></a>, 
            <a class="link" href="ATScross.html" title="ATScross"><em class="citetitle">ATScross</em></a>, 
            <a class="link" href="ATSinterpread.html" title="ATSinterpread"><em class="citetitle">ATSinterpread</em></a>, 
            <a class="link" href="ATSadd.html" title="ATSadd"><em class="citetitle">ATSadd</em></a>, 
            <a class="link" href="ATSaddnz.html" title="ATSaddnz"><em class="citetitle">ATSaddnz</em></a></p>
      </div>
      <div class="refsect1">
        <a id="idp91103968"></a>
        <h2>Credits</h2>
        <p>
            </p>
        <table border="0" summary="Simple list" class="simplelist">
          <tr>
            <td>Author: Alex Norman</td>
          </tr>
          <tr>
            <td>Seattle,Washington</td>
          </tr>
          <tr>
            <td>2004</td>
          </tr>
        </table>
        <p>
        </p>
      </div>
    </div>
    <div class="navfooter">
      <hr />
      <table width="100%" summary="Navigation footer">
        <tr>
          <td width="40%" align="left"><a accesskey="p" href="ATSreadnz.html">Prev</a> </td>
          <td width="20%" align="center">
            <a accesskey="u" href="OpcodesTop.html">Up</a>
          </td>
          <td width="40%" align="right"> <a accesskey="n" href="ATSsinnoi.html">Next</a></td>
        </tr>
        <tr>
          <td width="40%" align="left" valign="top">ATSreadnz </td>
          <td width="20%" align="center">
            <a accesskey="h" href="index.html">Home</a>
          </td>
          <td width="40%" align="right" valign="top"> ATSsinnoi</td>
        </tr>
      </table>
    </div>
  </body>
</html>
